package com.jr.service;

import com.jr.entity.Order;

import java.util.List;

public interface OrderService {
    /**
     * 根据企业id查询所有订单
     * @param enterpriseId
     * @return
     * @throws Exception
     */
    List<Order> selectAllOrder(Integer enterpriseId)throws Exception;

    long getOrderTotal(Integer enterpriseId) throws Exception;
    List<Order> listOrder(Integer enterpriseId,int start,int pageSize) throws Exception;

    int delete(String no)throws Exception;

    /**
     * 根据发票id查询所有相关订单
     * @param invoiceId
     * @return
     * @throws Exception
     */
    List<Order> invoiceOrder(Integer invoiceId)throws Exception;

    /**
     * 根据发票id计算开票订单总金额
     * @param invoiceId
     * @return
     * @throws Exception
     */
    Double TotalAmount(Integer invoiceId) throws Exception;

    /**
     * 订单总金额
     * @return
     * @throws Exception
     */
    Double sumAmount()throws Exception;

    /**
     * 根据开票状态计算已开票的订单总金额
     * @return
     * @throws Exception
     */
    Double finishSumAmount()throws Exception;

    int update(String no)throws Exception;

    int updateStatus(String no)throws Exception;

    /**
     * 根据id进行退票
     * @param invoiceId
     * @return
     * @throws Exception
     */
    int refundTicket(Integer invoiceId)throws Exception;

}
